/**
 * index_a.css
 * 
 * Copyright (c) 2016-2017 QiuPeng All rights reserved.
 * 
 * CREATED BY QiuPeng 2016-09-24
 * 
 */
$(function() {
	var tableChart = echarts.init(document.getElementById('i-tablepic'));
	var mainChart = echarts.init(document.getElementById('i-mainpic'));
	var secChart = echarts.init(document.getElementById('i-secpic'));
	var tableOption = {
		tooltip: {
			trigger: 'item',
			formatter: "{a} <br/>{b} : {c} ({d}%)"
		},
		legend: {
			orient: 'vertical',
			x: 'right',
			y: 'center',
			//left:420,
			data: [
				{name: '华山派',icon: 'pin',textStyle: {color: '#C23531'}}, 
				{name: '泰山派',icon: 'pin',textStyle: {color: '#61A0A8'}}, 
				{name: '恒山派',icon: 'pin',textStyle: {color: '#354D5E'}}, 
				{name: '衡山派',icon: 'pin',textStyle: {color: '#DD8668'}}, 
				{name: '嵩山派',icon: 'pin',textStyle: {color: '#91C7AE'}}
			]
		},
		calculable: false,
		series: [{
			name: '笑傲江湖',
			type: 'pie',
			radius: '85%',
			center: ['40%', '48%'],
			data: [
				{value: 335,name: '华山派' }, 
				{value: 310,name: '恒山派'},
				{value: 234,name: '泰山派'}, 
				{value: 135,name: '衡山派'}, 
				{value: 1548,name: '嵩山派'}
			]
		}]
	};

	var mainOption = {
		tooltip: {
			trigger: 'axis'
		},
		toolbox: {
			show: true,
			//left:920,
			feature: {
				mark: {
					show: true
				},
				dataView: {
					show: true,
					readOnly: false
				},
				magicType: {
					show: true,
					type: ['line', 'bar']
				},
				restore: {
					show: true
				},
				saveAsImage: {
					show: true
				}
			}
		},
		legend: {
			padding: [30, 30, 0, 0],
			data: [{
				name: '恒山派',
				icon: 'roundRect',
				textStyle: {
					color: '#DD8668'
				}
			}]
		},
		calculable: true,
		xAxis: [{
			type: 'category',
			boundaryGap: false,
			data: ['1848年', '1849年', '1859年', '1869年', '1879年', '1889年', '1899年']
		}],
		yAxis: [{
			type: 'value'
		}],
		series: [{
			name: '恒山派',
			type: 'line',
			stack: '总量',
			itemStyle: {
				normal: {
					areaStyle: {
						type: 'default'
					}
				}
			},
			data: [90, 232, 120, 284, 140, 270, 230]
		}]
	};

	var secOption = {
		tooltip: {
			trigger: 'axis'
		},
		legend: {
			data: ['2011年', '2012年']
		},
		toolbox: {
			show: true,
			//left:920,
			feature: {
				mark: {
					show: true
				},
				dataView: {
					show: true,
					readOnly: false
				},
				magicType: {
					show: true,
					type: ['line', 'bar']
				},
				restore: {
					show: true
				},
				saveAsImage: {
					show: true
				}
			}
		},
		calculable: true,
		xAxis: [{
			type: 'value',
			boundaryGap: [0, 0.01]
		}],
		yAxis: [{
			type: 'category',
			data: ['仪琳师妹', '仪玉师姐', '仪和师姐', '仪清师姐', '定逸师太', '定闲师太']
		}],
		series: [{
			name: '恒山派弟子战力值',
			type: 'bar',
			data: [19325, 23438, 31000, 121594, 134141, 681807]
		}]
	};

	tableChart.setOption(tableOption);
	mainChart.setOption(mainOption);
	secChart.setOption(secOption);

	$('#c-main-right-tablepic-table-t').DataTable({
        bFilter: false,
        bLengthChange: false,
        bPaginate:false,
        bLengthChange:false,
        bInfo:false,
        columnDefs: [{
	            targets: [ 0 ],
	            orderData: [ 0, 1 ]
        	}, {
	            targets: [ 1 ],
	            orderData: [ 1, 0 ]
        	}, {
	            targets: [ 4 ],
	            orderData: [ 4, 0 ]
        }]
    });
    
})